/*************************************************
filename	: system_module.h
author		: Stefan lulham
desc		: Contains the base system
*************************************************/
#ifndef D_SYSTEM_H
#define D_SYSTEM_H

#include <vector>

#include <platform.h>
#include <modules\module.h>

#include <modules\system\system_enums.h>
#include <modules\system\system_interface.h>
#include <modules\system\system_videoMode.h>
#if defined (DELGE_PLATFORM_WIN32)
#include <modules\system\win32\win32_system_interface.h>
#endif

#undef CreateWindow

using namespace std;

namespace DelGE
{
	namespace Modules
	{
		namespace System
		{
			class SystemModule : public Module
			{
			private:
				#if defined(DELGE_PLATFORM_WIN32)
				Win32SystemInterface* pWin32_Interface;
				#endif

				bool bIsMouseHidden;

			protected:
				void LoadModule();
				void UnloadModule();

			public:
				SystemModule();
				~SystemModule();

				#if defined(DELGE_PLATFORM_WIN32)
				Win32SystemInterface* GetInterface_Win32();
				#endif

				SystemWindow* CreateWindow(string sCaption, int iWidth, int iHeight, DelGESystemWindowStyle eStyle = DelGESystemWindowStyle_FixedSize);
				SystemTimer* CreateTimer();

				void DestroyGadget(SystemGadget* pSystemGadget);
				void DestroyTimer(SystemTimer* pSystemTimer);

				void Update();

				vector<SystemVideoMode> GetSupportedVideoModes();
				SystemVideoMode GetCurrentVideoMode();
				bool IsVideoModeSupported(const SystemVideoMode &systemVideoMode);
				void ChangeVideoMode(const SystemVideoMode &systemVideoMode);
				void RestoreVideoMode();
				SystemVideoMode FindNearestSupportedVideoMode(const SystemVideoMode &systemVideoMode);

				void HideMouse();
				void ShowMouse();
				bool IsMouseHidden();
			};
		}
	}
}

#endif